<template>
    <!--建档资料维护模块 健康告知页面-->
    <div class="baseInfoPage">
        <el-form :rules="rules"  label-width="100px" class="search_container">
                <el-row>
                    <el-col :span="6">
                        <el-form-item label="被保险人" prop="surname">
                            <el-input v-model="euad2.surname" disabled placeholder="被保险人"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="身高(厘米)" prop="height">
                            <el-input-number  :disabled="flag =='N'" v-model="euad2.height" @change="changEuad2Bmi"
                                style="margin-right:2px!important;" :min="0" :max="999"
                                :precision="1" :step="0.1" controls-position="right" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="体重(公斤)" prop="weight">
                            <el-input-number :disabled="flag =='N'" v-model="euad2.weight" @change="changEuad2Bmi"
                                style="margin-right:2px!important;" :min="0" :max="999"
                                :precision="2" :step="0.1" controls-position="right" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="BMI" prop="bmi">
                            <el-input-number v-model="euad2.bmi" disabled
                                style="margin-right:2px!important;" :min="0"
                                :precision="2" :step="0.1" controls-position="right" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <!--     第二被保人需求 start   -->
                <el-row v-if="euad3.surname">
                  <el-col :span="6">
                    <el-form-item label="第二被保险人" prop="surname">
                      <el-input v-model="euad3.surname" disabled placeholder="第二被保险人"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item label="身高(厘米)" prop="height">
                      <el-input-number  :disabled="flag =='N'" v-model="euad3.height" @change="changEuad3Bmi"
                                        style="margin-right:2px!important;" :min="0" :max="999"
                                        :precision="1" :step="0.1" controls-position="right" />
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item label="体重(公斤)" prop="weight">
                      <el-input-number :disabled="flag =='N'" v-model="euad3.weight" @change="changEuad3Bmi"
                                       style="margin-right:2px!important;" :min="0" :max="999"
                                       :precision="2" :step="0.1" controls-position="right" />
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item label="BMI" prop="bmi">
                      <el-input-number v-model="euad3.bmi" disabled
                                       style="margin-right:2px!important;" :min="0"
                                       :precision="2" :step="0.1" controls-position="right" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <!--  第二被保人需求 end  -->
                <el-row>
                    <el-col :span="6">
                        <el-form-item label="投保人" prop="surname">
                            <el-input v-model="euad1.surname" disabled placeholder="投保人"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="身高(厘米)" prop="height">
                            <el-input-number  v-model="euad1.height" @change="changEuad1Bmi"
                                :disabled="euad1Disabled.height || flag =='N'"
                                style="margin-right:2px!important;" :min="0" :max="999"
                                :precision="1" :step="0.1" controls-position="right" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="体重(公斤)" prop="weight">
                            <el-input-number  v-model="euad1.weight" @change="changEuad1Bmi"
                                :disabled="euad1Disabled.weight || flag=='N'"
                                style="margin-right:2px!important;" :min="0" :max="999"
                                :precision="2" :step="0.1" controls-position="right" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="BMI" prop="bmi">
                             <el-input-number v-model="euad1.bmi" disabled
                                style="margin-right:2px!important;" :min="0"
                                :precision="2" :step="0.1" controls-position="right" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <!--     第二被保人需求  start  -->
          <!--<el-row class="mt5" v-if="euad3.surname">
            <el-col :span="8" :offset="6">
              <el-col :span="10" class="common-lab">
                <label class="labelName">第二被保人体检是否正常</label>
              </el-col>
              <el-col :span="14">
                <el-input  v-model="euad3.physclExamFlag1" ></el-input>
              </el-col>
            </el-col>
          </el-row>-->
                <!--     第二被保人需求  end  -->
                <el-row class="mt20">
                    <!-- 操作按钮 -->
                    <div style="display: none;">123</div>
                    <el-col :span="4">
                        <el-button :disabled="flag =='N'" @click="addEuaf" type="danger" plain>新增</el-button>
                    </el-col>

                    <el-col :span="8">
                        <el-col :span="10" class="common-lab">
                             <label class="labelName">被保人体检是否正常</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input  v-model="euad1.physclExamFlag1" ></el-input>
                        </el-col>
                    </el-col>
                    <el-col :span="8">
                        <el-col :span="10" class="common-lab">
                             <label class="labelName">投保人体检是否正常</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input v-model="euad2.physclExamFlag2" ></el-input>
                        </el-col>
                    </el-col>

                </el-row>
        </el-form>

        <div class="table_container">
            <el-table
                :data="euafs"
                highlight-current-row
                @row-click="curRowClcik"
                header-cell-class-name="table-header-class"
                style="width:100%">
                <el-table-column
                width="250"
                    property="clntnum"
                    label="告知对象"
                    align='left'>
                        <template slot-scope="scope">
                            <el-col :span="18" class="position">
                                <el-input disabled v-model="scope.row.userName" ></el-input>
                                <div class="plain_btn">
                                    <el-button type="primary" :disabled="flag =='N'" plain @click="euafChoiceClick(scope.$index,scope.row)">选择</el-button>
                                </div>
                            </el-col>
                        </template>
                    </el-table-column>
                    <el-table-column
                        width="100"
                        property="informno"
                        label="代码"
                        align='center'>
                            <template slot-scope="scope">
                                <div class="hel-select-mian" :ref="`picSelect${scope.row.index}`">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.informno" @change="checkEuafpkyInformno(scope.$index,scope.row)" ></el-input>
                                </div>
                            </template>
                    </el-table-column>
                    <el-table-column
                        width="180"
                        property="informdesc"
                        label="说明"
                        align='center'>
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.informdesc" disabled :title="scope.row.informdesc"></el-input>
                            </template>
                    </el-table-column>
                    <el-table-column
                        width="180"
                        property="notedesc"
                        label="补充说明"
                        align='center'>
                            <template slot-scope="scope">
                                <el-input :disabled="flag =='N'" v-model="scope.row.notedesc" ></el-input>
                            </template>
                    </el-table-column>


                    <!-- 代码974 -->
                    <div>
                        <el-table-column
                            min-width="80"
                            property="weeks"
                            label="怀孕周数"
                            v-if="code974"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.weeks"
                                        v-if="scope.row.informno == '974'||scope.row.informno == '978'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            property="flag01"
                            label="是否产检"
                            v-if="code974"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-select  :disabled="flag =='N'" v-model="scope.row.flag01"
                                        v-if="scope.row.informno == '974'||scope.row.informno == '978'">
                                        <el-option
                                            v-for="item in flag01s"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                        </el-table-column>
                    </div>
                    <!-- 代码981 -->
                    <div>
                        <el-table-column
                            min-width="120"
                            property="weeks"
                            label="怀孕周数"
                            v-if="code981"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.weeks"
                                      v-if="scope.row.informno == '981'||scope.row.informno == '982'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            property="days"
                            label="住院天数"
                            v-if="code981"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.days"
                                        v-if="scope.row.informno == '981'||scope.row.informno == '982'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            property="instprem01"
                            v-if="code981"
                            label="出生体重(公斤)"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.instprem01"
                                        v-if="scope.row.informno == '981'||scope.row.informno == '982'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <!-- 代码984 -->
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code984"
                            property="weeks"
                            label="单位（支/天）"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.weeks"
                                        v-if="scope.row.informno == '984'||scope.row.informno == '995'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code984"
                            property="quantity"
                            label="吸烟年数"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.quantity"
                                        v-if="scope.row.informno == '984'||scope.row.informno == '995'"></el-input>
                                </template>
                        </el-table-column>
                    </div>

                    <!-- 代码909--驾驶频率、驾驶用途 -->
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code909"
                            property="weeks"
                            label="驾驶频率"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.weeks"
                                        v-if="scope.row.informno == '909'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code909"
                            property="quantity"
                            label="驾驶用途"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.quantity"
                                        v-if="scope.row.informno == '909'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <!-- 代码985--饮酒 -->
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code985"
                            property="weeks"
                            label="饮酒年数"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.weeks"
                                        v-if="scope.row.informno == '985'||scope.row.informno == '922'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code985"
                            property="quantity"
                            label="单位(两/周)"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.quantity"
                                        v-if="scope.row.informno == '985'||scope.row.informno == '922'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code985"
                            property="fieldType"
                            label="种类"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-select :disabled="flag =='N'" v-model="scope.row.fieldType"
                                        v-if="scope.row.informno == '985'||scope.row.informno == '922'" >
                                        <el-option
                                            v-for="item in types"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                        </el-table-column>
                    </div>
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code985"
                            property="instprem01"
                            label="出生体重(公斤)"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.instprem01"
                                         v-if="scope.row.informno == '985'||scope.row.informno == '922'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <!-- 代码992--身故保额总和 -->
                    <div>
                        <el-table-column
                            min-width="80"
                            v-if="code992"
                            property="instprem01"
                            label="身故保额总和"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input :disabled="flag =='N'" v-model="scope.row.instprem01"
                                        v-if="scope.row.informno == '992'"></el-input>
                                </template>
                        </el-table-column>
                    </div>
                    <el-table-column
                        label="操作"
                        align='center'>
                            <template slot-scope="scope">
                                <span   @click="removeEuaf(scope.$index, scope.row)" class="operationIcon">
                                    <!-- 删除操作 -->
                                    <el-tooltip  class="item" effect="light" content="删除" placement="top">
                                        <i class="el-icon-delete"></i>
                                    </el-tooltip>
                                </span>
                            </template>
                    </el-table-column>
                </el-table>
        </div>

        <div class="title mt20">
            <span>家族史</span>
        </div>
        <div class="table_container">
            <el-table
                :data="cusf01List"
                highlight-current-row
                header-cell-class-name="table-header-class"
                style="width:100%">
                <el-table-column
                    property="NOTE0"
                    label="对象"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="NOTE1"
                    label="Note1"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="REMARK01"
                    label="生存情况"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="INSTPREM01"
                    label="年龄"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="NOTE2"
                    label="Note2"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="REMARK02"
                    label="健康状态"
                    align='center'>
                </el-table-column>
                <el-table-column
                    property="NOTEDESC"
                    label="内容"
                    align='center'>
                </el-table-column>
            </el-table>
        </div>

        <!-- 弹框 告知对象（选择按钮）-->
        <el-dialog
            title="告知对象"
            :visible.sync="asIdDialogVisible"
            width="70%"
            center>
            <el-row>
                <el-col :span="24">
                    <el-table class="mt20"
                        ref="multipleTable"
                        :data="clnts"
                        @row-click="clntRowClick"
                        tooltip-effect="dark"
                        style="width: 100%">
                        <el-table-column
                        prop="secuityno"
                        label="证件号码">
                        </el-table-column>
                        <el-table-column
                        prop="surname"
                        label="姓名">
                        </el-table-column>
                        <el-table-column
                        prop="clntnum"
                        label="客户号">
                        </el-table-column>
                        <el-table-column
                        prop="anbAtCcd2"
                        label="年龄">
                        </el-table-column>
                        <el-table-column
                        prop="cltsex"
                        label="性别">
                        <template  slot-scope="scope">
                            <div v-for="sex in sexs" :key="sex.value">
                                <div v-if="sex.value==scope.row.cltsex">
                                    {{sex.label}}
                                </div>
                            </div>
                        </template>
                        </el-table-column>
                        <el-table-column
                        prop="flag"
                        label="FLAG">
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <span slot="footer" class="dialog-footer">
                <el-button @click="asIdDialogVisible = false">返 回</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
    import { checkEuafpkyInformno,checkEuafClntnum } from "@/api/policyRecord/materialsMaintain/insurance.js";

    import constant from '@/utils/constant';
    export default {
        data(){
            return {
                value:'',
                asIdDialogVisible: false,
                euad1: {},
                euad2: {},
                euad3: {}, // 第二被保人
                euafs: [],// 告知对象
                cusf01List: [],// 家族史
                rules: {},
                insureDataForm: this.insureData,
                euafSelectIndenx: null,
                clnts: [],
                sexs:[
                    {value:'',label:''},
                    {value:'M',label:'男'},
                    {value:'F',label:'女'},
                    {value:'U',label:'不明'}
                ],
                opinionDialogVisible8: false,
                pnIndex: 0,
                paginations: {
                    total: 0,        // 总数
                    pageIndex: 1,  // 当前位于哪页
                    pageSize: 2,   // 1页显示多少条
                    pageSizes: [5, 10, 15, 20],  //每页显示多少条
                    layout: "total, sizes, prev, pager, next, jumper",   // 翻页属性
                    pndesc: "",
                    pntype: ""
                },
                pnCodes:[
                    {pncode: '984',pedesc: '吸烟'},
                    {pncode: '981',pedesc: '是否为低体重儿'},
                    {pncode: '974',pedesc: '目前是否怀孕'},
                    {pncode: '909',pedesc: '摩托车驾驶证' },
                    {pncode: '101',pedesc: '高血压'}
                ],
                code984: false,
                code981: false,
                code974: false,
                code909: false,
                code985: false,
                code992: false,
                types:[
                    {value:'',label:''},
                    {value:'B',label:'B-啤酒'},
                    {value:'M',label:'W-红酒'},
                    {value:'C',label:'C-白酒'},
                    {value:'U',label:'U-不明'}
                ],
                flag01s:[
                    {value:'',label:''},
                    {value:'Y',label:'是'},
                    {value:'N',label:'否'}
                ],
                euad1Disabled:{weight:false,height:false}
            }
        },
        props:{
			flag:{
				type:String
			},
            insureData:{
                type: Object,
            }
        },
        mounted(){
            this.reloadInsureData(null);

            // 监控点击代码 下拉框外隐藏弹框
            document.addEventListener('click', this.clickEvent);
        },
        destroyed() {
            document.removeEventListener("click",this.clickEvent);
        },
        methods: {
            clickEvent(e){
                let flag = this.isChild(e.target, this.$(this.gobalEle)[0]);
                let excflag = this.isChild(e.target, this.$(this.gobalExc)[0]);
                if (!(this.isChild(e.target, this.$('.select-main')[0])) && !flag) {
                    this.opinionDialogVisible8 = false;
                }
            },
            // 判断当前元素是否为某元素的子元素
            isChild(e, parent) {
                while (e != undefined && e != null && e.tagName.toUpperCase() != 'BODY') {
                if (e == parent) {
                    return true;
                }
                e = e.parentNode;
                }
                return false;
            },
            removeEuaf(index,row){
				if (this.flag == 'N') {
					return null;
				}
                this.euafs.splice(index,1);
            },
            addEuaf(){
                let euaf = {
                    "applnum": "","clntnum": "","informno": "",
                    "switchIndicator": "","weeks": 0,"quantity": 0,
                    "fieldType": "","days": 0,"": "","dtecrt": 0,
                    "crttime": 0,"userProfile": "",
                    "jobName": "","datime": "",
                    "descitem": "","notedesc": "","flag01": "",
                    "flag02": "","flag03": "","flag04": "",
                    "flag05": "","instprem01": 0,
                    "instprem02": 0,"instprem03": 0,
                    "instprem04": 0,"instprem05": 0
                }
                this.euafs.push(euaf);
            },
            reloadInsureData(insureData){
                if(insureData != null){
                    this.insureDataForm = insureData;
                }
                this.euad1 = this.insureDataForm.euad1;
                this.euad2 = this.insureDataForm.euad2;
                // 第二被保人
                this.euad3 = this.insureDataForm.euad3;
                this.euafs = this.insureDataForm.euafs;
                this.cusf01List = this.insureDataForm.cusf01List;
                this.clnts = [];
                let euad1 = this.insureDataForm.euad1;
                let euad2 = this.insureDataForm.euad2;
                // 第二被保人
                let euad3 = this.insureDataForm.euad3;
                if(euad1.clntnum == euad2.clntnum){
                    this.clnts.push({secuityno:euad1.secuityno,surname:euad1.surname,
                                    clntnum:euad1.clntnum,anbAtCcd2:euad1.anbAtCcd2,
                                    cltsex:euad1.cltsex,mortcls:euad1.mortcls,
                                    flag:'健康告知'});
                }else{
                    this.clnts.push({secuityno:euad1.secuityno,surname:euad1.surname,
                                    clntnum:euad1.clntnum,anbAtCcd2:euad1.anbAtCcd2,
                                    cltsex:euad1.cltsex,mortcls:euad1.mortcls,
                                    flag:'健康告知'});
                    this.clnts.push({secuityno:euad2.secuityno,surname:euad2.surname,
                                    clntnum:euad2.clntnum,anbAtCcd2:euad2.anbAtCcd2,
                                    cltsex:euad2.cltsex,mortcls:euad2.mortcls,
                                    flag:'健康告知'});
                    // 第二被保人
                    this.clnts.push({secuityno:euad3.secuityno,surname:euad3.surname,
                                    clntnum:euad3.clntnum,anbAtCcd2:euad3.anbAtCcd2,
                                    cltsex:euad3.cltsex,mortcls:euad3.mortcls,
                                    flag:'健康告知'});
                }
                this.setwhDisabled(euad1.fmlyreln);
                this.code984 = false;
                this.code981 = false;
                this.code974 = false;
                this.code909 = false;
                this.code985 = false;
                this.code992 = false;
            },
            setwhDisabled(fmlyreln){
                if(fmlyreln == '1'){
                    this.euad1Disabled.weight = true;
                    this.euad1Disabled.height = true;
                }else{
                    this.euad1Disabled.weight = false;
                    this.euad1Disabled.height = false;
                }
            },
            getInsureData(){
                this.insureDataForm.euafs = this.euafs;
                return this.insureDataForm;
            },
            clntRowClick(row, column, event){
                this.euafs[this.euafSelectIndenx].clntnum = row.clntnum;
                this.euafs[this.euafSelectIndenx].userName = row.surname;
                this.checkEuafClntnum(this.euafSelectIndenx,this.euafs[this.euafSelectIndenx]);
                let list = JSON.parse(JSON.stringify(this.euafs));
                this.euafs = list;
                this.insureDataForm.euafs = list;
                this.asIdDialogVisible = false;
            },
            euafChoiceClick(index,row){
                console.info(index);
                this.euafSelectIndenx = index;
                this.asIdDialogVisible = true;
            },
            checkEuafClntnum(index,euaf){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let para = {
                    euaf: euaf,
                    euafpkyList: this.euafs
                };
                checkEuafClntnum(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                        let data = res.data;
                        if(data != null){
                            if(data.euafpkyForm_clntnum != undefined){
                                euaf.clntnum = data.euafpkyForm_clntnum;
                            }
                            if(data.euafpkyFormSurname != undefined){
                                euaf.userName = data.euafpkyFormSurname;
                            }
                            if(data.euafpkyForm_informno != undefined){
                                euaf.informno = data.euafpkyForm_informno;
                            }
                            if(data.euafpkyForm_informdesc != undefined){
                                euaf.informdesc = data.euafpkyForm_informdesc;
                            }
                             if(data.euafpkyForm_switchIndicator != undefined){
                                euaf.switchIndicator = data.switchIndicator;
                            }
                            this.euafs[index] = euaf;
                            let list = JSON.parse(JSON.stringify(this.euafs));
                            this.euafs = list;
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                                return false;
                            }
                            this.curRowClcik(row);
                        }
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
            checkEuafpkyInformno(index,row){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let para = {
                    weeks: '',
                    euaf: row,
                    euafpkyList: this.euafs
                };
                checkEuafpkyInformno(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                        let data = res.data;
                        if(data != null){
                            if(data.euafpkyForm_informno != undefined){
                                row.informno = data.euafpkyForm_informno;
                            }
                            if(data.euafpkyForm_informdesc != undefined){
                                row.informdesc = data.euafpkyForm_informdesc;
                            }
                            if(data.euafpkyForm_switchIndicator != undefined){
                                row.switchIndicator = data.euafpkyForm_switchIndicator;
                            }
                            let list = JSON.parse(JSON.stringify(this.euafs));
                            this.euafs = list;
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                                return false;
                            }
                            this.curRowClcik(row);
                        }
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
            getBmi(weight,height){
                 let bmi = (weight/Math.pow(height/100,2)).toFixed(2);
                 console.info(bmi);
                 return bmi;
            },
            changEuad1Bmi(val){
                this.euad1.bmi = this.getBmi(this.euad1.weight,this.euad1.height);
            },
            changEuad2Bmi(val){
                this.euad2.bmi = this.getBmi(this.euad2.weight,this.euad2.height);
            },
            // 第二被保人需求-计算bmi
            changEuad3Bmi(val){
              this.euad3.bmi = this.getBmi(this.euad3.weight,this.euad3.height);
            },
            // 点击table 聚焦某行
            curRowClcik(row){
                this.code984 = false;
                this.code981 = false;
                this.code974 = false;
                this.code909 = false;
                this.code985 = false;
                this.code992 = false;
                if(row.informno == '984'||row.informno == '995'){
                    this.code984 = true;
                } else if(row.informno == '981'||row.informno == '982'){
                    this.code981 = true;
                } else if(row.informno == '974'||row.informno == '978'){
                    this.code974 = true;
                } else if(row.informno == '909'){
                    this.code909 = true;
                } else if(row.informno == '985'||row.informno == '922'){
                    this.code985 = true;
                }else if(row.informno == '992'){
                    this.code992 = true;
                }
            }


        },
        watch:{

        }
    }
</script>
<style lang="less" scoped>
.baseInfoPage{
    // 操作删除图标
         .operationIcon{
            border:1px solid #e5e5e5;
            box-shadow:0 0 3px #f9f9f9;
            border-radius: 50%;
            cursor: pointer;
            color: #68a3fc;
            display: inline-block;
            width: 22px;
            height: 22px;
        }
    .premium{
         border-top: 1px solid #e1e1e1;
          background-color: #f5f5f5;
          padding: 10px 20px 0;
    }
    .common-box{
        padding-bottom: 15px;
    }
    .common-lab{
        line-height:normal!important;
        text-align: right;
        .labelName{
            text-align: right;
        }
    }
    .position{
        position: relative;
        .plain_btn{
        position: absolute;
        right: -65px;
        top: 0px;
        }
    }
    .operationIcon{
        border:1px solid #e5e5e5;
        box-shadow:0 0 3px #f9f9f9;
        border-radius: 50%;
        cursor: pointer;
        color: #68a3fc;
        display: inline-block;
        width: 22px;
        height: 22px;
    }
    .select-main {
        width: 50%;
        position: absolute;
        background: #fff;
        border-radius: 4px;
        top: 20%;
        z-index: 100000;
        padding: 20px;
        box-shadow: 0 0 10px #e1e1e1;

        .back-con {
            text-align: center;

            button {
                height: 30px;
                padding: 0 20px;
                background: #fff;
                border: 1px solid #e1e1e1;
                border-radius: 4px;
                cursor: pointer;

                &:hover {
                    color: #f56c6c;
                    background: #fef0f0;
                    border-color: #fbc4c4;
                }
            }
        }
    }
}
</style>
